GDK W32: Fix shown window position calculation for dialogs and splashes
authorРуслан Ижбулатов <lrn1986@gmail.com>
Mon, 14 Mar 2016 16:14:22 +0000 (16:14 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Mon, 14 Mar 2016 16:31:14 +0000 (16:31 +0000)
Two errors here:
1) A typo in splashscreen rectangle calculation - sets right twice
   instead of setting top
2) Centering for dialogs is off because it doesn't convert
   GDK virtual desktop coordinates to Windows WM virtual desktop
   coordinates by adding _gdk_offset_*

https://bugzilla.gnome.org/show_bug.cgi?id=763628

gdk/win32/gdkwindow-win32.c

index 353602e1adfb3df89441c9adad0ccee2eaa25086..d112d32d00e40e96d050230d742d786f5b5bbae7 100644 (file)
@@ -1207,7 +1207,7 @@ show_window_internal (GdkWindow *window,
          else
            {
              center_on_rect.left = 0;
-             center_on_rect.right = 0;
+             center_on_rect.top = 0;
              center_on_rect.right = GetSystemMetrics (SM_CXSCREEN);
              center_on_rect.bottom = GetSystemMetrics (SM_CYSCREEN);
            }
@@ -1218,8 +1218,8 @@ show_window_internal (GdkWindow *window,
        {
          GdkWindow *owner = window_impl->transient_owner;
          /* Center on transient parent */
-         center_on_rect.left = owner->x;
-         center_on_rect.top = owner->y;
+         center_on_rect.left = owner->x - _gdk_offset_x;
+         center_on_rect.top = owner->y - _gdk_offset_y;
          center_on_rect.right = center_on_rect.left + owner->width;
          center_on_rect.bottom = center_on_rect.top + owner->height;
          _gdk_win32_adjust_client_rect (GDK_WINDOW (owner), &center_on_rect);